package conceptmaniax.hotelapp.adapters;

public class Guide implements Comparable<Guide>{
	
	private String id;
	private String name;
	private int dayId;
	
	public Guide() {
		super();
	}

	public Guide(final String id, final String name, final int dayId) {
		this.id = id;
		this.name = name;
		this.dayId = dayId;
	}
	
	public String getId() {
		return id;
	}

	public void setId(final String id) {
		this.id = id;
	}


	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public int getDayId() {
		return dayId;
	}

	public void setDayId(final int dayId) {
		this.dayId = dayId;
	}

	@Override
	public int compareTo(final Guide obj) {
		if (this == obj) {
			return 0;
		}

		if (!(obj instanceof Guide)) {
			throw new ClassCastException("Invalid object");
		}

		final int objDayId = ((Guide) obj).getDayId();

		return (this.getDayId() > objDayId)?1:-1;
	}
	
	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}

		if (!(obj instanceof Guide)) {
			return false;
		}

		return (this.getDayId() == ((Guide) obj).getDayId());
	}

	@Override
	public int hashCode() {
		return 31 * 7 + this.dayId;
	}
}